package com.gopay.common.domain.autosettle;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 网银明细
 * Created by wangDaKui on 2017/08/10.
 */
@Entity
@Table(name = "AS_BANK_ORDER_DTL")
public class AsBankOrderDtl extends BaseEntity {
    /**
     * 主键
     */
    private Long id;
    /**
     * 国付宝订单号
     */
    private String gopayOrderId;
    /**
     * 银行流水号
     */
    private String bankOrderId;
    /**
     * 银行渠道
     */
    private String bankChannel;
    /**
     * 银行金额
     */
    private BigDecimal bankOrderAmt;
    /**
     * 银行交易时间
     */
    private Date bankTransTime;
    /**
     * 对方账户名
     */
    private String recvAcctName;
    /**
     * 对方账号
     */
    private String recvAcct;
    /**
     * 所属对账文件的id（关联对账文件管理表）
     */
    private BigDecimal checkOrderFileId;
    /**
     * 网银明细状态01成功02退回明细
     */
    private String bankOrderStatus;
    /**
     * 对账状态 （00-待对账，10-对平，20-存疑，30-差异，40-待更新状态，99-已人工处理）
     */
    private String checkOrderStatus;
    /**
     * 对账状态细分 （21-存疑短款，22-存疑长款，31-差异短款，32-差异长款，33-金额差异，41-成功明细，42-退回明细，43-无网银明细）
     */
    private String checkOrderStatusDtl;
    /**
     * 对账完成时间
     */
    private Date checkOrderFinishTime;
    /**
     * 备注
     */
    private String remark;
    /**
     * 最后修改时间
     */
    private Date lastUpdTs;
    /**
     * 最后修改人id
     */
    private String lastUpdOperId;
    /**
     * 乐观锁版本号
     */
    private Integer version;

    /**
     * 上传时间
     */
    private Date createdTs;
    @Id
    @SequenceGenerator(name = "AS_BANK_ORDER_DTL_SEQ_GENERATOR", sequenceName = "AS_BANK_ORDER_DTL_SEQ", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AS_BANK_ORDER_DTL_SEQ_GENERATOR")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "GOPAY_ORDER_ID")
    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }
    @Column(name = "BANK_ORDER_ID")
    public String getBankOrderId() {
        return bankOrderId;
    }

    public void setBankOrderId(String bankOrderId) {
        this.bankOrderId = bankOrderId;
    }
    @Column(name = "BANK_CHANNEL")
    public String getBankChannel() {
        return bankChannel;
    }

    public void setBankChannel(String bankChannel) {
        this.bankChannel = bankChannel;
    }
    @Column(name = "BANK_ORDER_AMT")
    public BigDecimal getBankOrderAmt() {
        return bankOrderAmt;
    }

    public void setBankOrderAmt(BigDecimal bankOrderAmt) {
        this.bankOrderAmt = bankOrderAmt;
    }
    @Column(name = "BANK_TRANS_TIME")
    public Date getBankTransTime() {
        return bankTransTime;
    }

    public void setBankTransTime(Date bankTransTime) {
        this.bankTransTime = bankTransTime;
    }
    @Column(name = "RECV_ACCT_NAME")
    public String getRecvAcctName() {
        this.recvAcctName = SensitiveInfoUtils.autoReencrypt(this.recvAcctName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.recvAcctName);
    }

    public void setRecvAcctName(String recvAcctName) {
        this.recvAcctName = SensitiveInfoUtils.smartEncryptWithCheck(recvAcctName);
    }
    @Column(name = "RECV_ACCT")
    public String getRecvAcct() {
        this.recvAcct = SensitiveInfoUtils.autoReencrypt(this.recvAcct);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.recvAcct);
    }

    public void setRecvAcct(String recvAcct) {
        this.recvAcct = SensitiveInfoUtils.smartEncryptWithCheck(recvAcct);
    }
    @Column(name = "CHECK_ORDER_FILE_ID")
    public BigDecimal getCheckOrderFileId() {
        return checkOrderFileId;
    }

    public void setCheckOrderFileId(BigDecimal checkOrderFileId) {
        this.checkOrderFileId = checkOrderFileId;
    }
    @Column(name = "BANK_ORDER_STATUS")
    public String getBankOrderStatus() {
        return bankOrderStatus;
    }

    public void setBankOrderStatus(String bankOrderStatus) {
        this.bankOrderStatus = bankOrderStatus;
    }
    @Column(name = "CHECK_ORDER_STATUS")
    public String getCheckOrderStatus() {
        return checkOrderStatus;
    }

    public void setCheckOrderStatus(String checkOrderStatus) {
        this.checkOrderStatus = checkOrderStatus;
    }
    @Column(name = "CHECK_ORDER_STATUS_DTL")
    public String getCheckOrderStatusDtl() {
        return checkOrderStatusDtl;
    }

    public void setCheckOrderStatusDtl(String checkOrderStatusDtl) {
        this.checkOrderStatusDtl = checkOrderStatusDtl;
    }
    @Column(name = "CHECK_ORDER_FINISH_TIME")
    public Date getCheckOrderFinishTime() {
        return checkOrderFinishTime;
    }

    public void setCheckOrderFinishTime(Date checkOrderFinishTime) {
        this.checkOrderFinishTime = checkOrderFinishTime;
    }
    @Column(name = "REMARK")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Column(name = "LAST_UPD_TS")
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }
    @Column(name = "LAST_UPD_OPER_ID")
    public String getLastUpdOperId() {
        return lastUpdOperId;
    }

    public void setLastUpdOperId(String lastUpdOperId) {
        this.lastUpdOperId = lastUpdOperId;
    }
    @Version
    @Column(name = "VERSION")
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
    @Column(name = "CREATED_TS")
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }
}